home *** CD-ROM | disk | FTP | other *** search
/ Holt Researcher: American History / Holt Researcher: American History.iso / pc / modules / dbtable.dxr / 00029_scroll button.ls < prev    next >
Encoding:
Text File  |  2000-01-18  |  1.2 KB  |  48 lines

  1. property ancestor, pSlider, pIsIncreasing
  2.  
  3. on new me, buttonName, castName, theChannel, theStageLoc, Slider, isIncreasing, descendant
  4.   if objectp(descendant) then
  5.     ancestor = new(script("generic button"), buttonName, castName, theChannel, theStageLoc, descendant)
  6.   else
  7.     ancestor = new(script("generic button"), buttonName, castName, theChannel, theStageLoc, me)
  8.   end if
  9.   pSlider = Slider
  10.   pIsIncreasing = isIncreasing
  11.   return me
  12. end
  13.  
  14. on trackMouse me
  15.   if not me.pIsDisabled then
  16.     performFunction(me._me)
  17.     repeat while the mouseDown
  18.       State = the memberNum of sprite me.pChannel
  19.       if rollOver(me.pChannel) then
  20.         set the member of sprite the pChannel of me to me.pDownState
  21.         performFunction(me._me)
  22.       else
  23.         set the member of sprite the pChannel of me to me.pUpState
  24.       end if
  25.       if not (State = the memberNum of sprite me.pChannel) then
  26.         updateStage()
  27.       end if
  28.     end repeat
  29.     set the member of sprite the pChannel of me to me.pUpState
  30.     updateStage()
  31.   end if
  32.   return me
  33. end
  34.  
  35. on performFunction me
  36.   setting = getSetting(pSlider)
  37.   if pIsIncreasing then
  38.     setThumb(pSlider, setting + 1)
  39.   else
  40.     setThumb(pSlider, setting - 1)
  41.   end if
  42.   return me
  43. end
  44.  
  45. on buttonLoc me
  46.   return me
  47. end
  48.